home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ For TASM / HEAP.PAK / DISPLAY.ASM next >
Assembly Source File  |  1996-02-21  |  2KB  |  92 lines

  1. page 75,132
  2. %Title "Display routines"
  3. ; Copyright (c) 1993 By Borland International, Inc.
  4.  
  5. ifndef MDL
  6.     display "Error: This module requires that you provide a memory model"
  7.     display "    definition on the command line. I.E. /dMDL=SMALL."
  8.  
  9. MDL equ <SMALL>
  10. endif
  11.  
  12. .model small,pascal
  13. .code
  14.  
  15.  
  16. include display.inc
  17.  
  18. page
  19. ;****************************************************************
  20. ; Screen Utilities
  21.  
  22. ; Show value in DL as a hex digit
  23. showhexdigit proc near
  24.          add  dl,'0'
  25.          cmp  dl,'9'
  26.          jbe  showhexdigit_showit
  27.          add  dl,'A'-'0'-10   ; Convert to A,B,C,D,E,F
  28. showhexdigit_showit:
  29.          mov  ah,DOSPRINTCHAR
  30.          int  DOSINT
  31.          ret
  32. showhexdigit endp
  33.  
  34.  
  35. ; Show value in BH as a hexidecimal byte
  36. ShowHexByte proc
  37.          mov  dl,bh
  38.          shr  dl,1
  39.          shr  dl,1
  40.          shr  dl,1
  41.          shr  dl,1
  42.          call showhexdigit
  43.          mov  dl,bh
  44.          and  dl,0fh
  45.          call showhexdigit
  46.          ret
  47. ShowHexByte endp
  48.  
  49.  
  50.  
  51. ; Show value in AX as a hexadecimal word
  52. ShowHexWord proc
  53.          mov  bx,ax
  54.          call ShowHexByte
  55.          mov  bh,bl
  56.          call ShowHexByte
  57.          ret
  58. ShowHexWord endp
  59.  
  60.  
  61.  
  62. Show_Bracket proc
  63.          mov  ah,DOSPRINTCHAR
  64.          mov  dl,'['
  65.          int  DOSINT
  66.          ret
  67. Show_Bracket endp
  68.  
  69.  
  70.  
  71. Show_Endbracket proc
  72.          mov  ah,DOSPRINTCHAR
  73.          mov  dl,']'
  74.          int  DOSINT
  75.          ret
  76. Show_Endbracket endp
  77.  
  78.  
  79.  
  80. CRLF     proc
  81.          mov  ah,DOSPRINTCHAR
  82.          mov  dl,CR
  83.          int  DOSINT
  84.          mov  dl,LF
  85.          int  DOSINT
  86.          ret
  87. CRLF     endp
  88.  
  89. end
  90.  
  91.  
  92.